Manages the blend states available in the component. More...
Public Member Functions | |
~BlendStateManager () | |
BlendState * | createOrRetrieve (const nkMemory::StringView &name) |
BlendState * | get (const nkMemory::StringView &name) |
BlendState * | getByIndex (unsigned int index) |
void | rename (const nkMemory::StringView &oldName, const nkMemory::StringView &newName) |
void | erase (const nkMemory::StringView &name) |
BlendState * | getDefaultState () const |
Manages the blend states available in the component.
The manager owns the memory it allocates. External code should never free memory returned.
nkGraphics::BlendStateManager::~BlendStateManager | ( | ) |
Destructor.
BlendState* nkGraphics::BlendStateManager::createOrRetrieve | ( | const nkMemory::StringView & | name | ) |
Creates if unavailable, or retrieves if available, a state.
name | The name of the state to retrieve. |
BlendState* nkGraphics::BlendStateManager::get | ( | const nkMemory::StringView & | name | ) |
Retrieves a state.
name | The name of the state to retrieve. |
BlendState* nkGraphics::BlendStateManager::getByIndex | ( | unsigned int | index | ) |
Retrieves a state by index. Note that an index can map to different states as the internal memory is changed. Mainly used for looping over all states in one go.
index | The index of the state to retrieve. |
void nkGraphics::BlendStateManager::rename | ( | const nkMemory::StringView & | oldName, |
const nkMemory::StringView & | newName | ||
) |
Renames a state, changing both its name and the way to address it in the manager.
oldName | The name of the state to rename. |
newName | The new name to attach to it. |
void nkGraphics::BlendStateManager::erase | ( | const nkMemory::StringView & | name | ) |
Erases and frees the memory allocated for a state.
name | The name of the state to erase. |
BlendState* nkGraphics::BlendStateManager::getDefaultState | ( | ) | const |